{% load i18n %}
{% extends "base.html" %}
{% block header %}
<link rel="stylesheet" href="/tinymce/wordpress.css" type="text/css"/>
<style type='text/css' media='all'>
	div#TB_title {
		background-color: #222222;
		color: #cfcfcf;
	}
	div#TB_title a, div#TB_title a:visited {
		color: #cfcfcf;
	}

</style>


{% endblock %}

{% block h_message %}
  {%if postback%}
    <div class="info {%if not result%}error{%endif%}">{{msg}}</div>
  {%endif%}
{% endblock %}
{% block nav2 %}
<div id="dnav2"><a href="/admin/post" {%ifequal entrytype 'post'%} class="current" {%endifequal%}>{%trans "New Post" %}</a>  <a href="/admin/page" {%ifequal entrytype 'page'%} class="current" {%endifequal%}>{%trans "New Page" %}</a>
</div>
{% endblock %}

 {% block content %}
 <!-- tinyMCE -->
<script language="javascript" type="text/javascript"
src="/static/js/editor.js"></script>
<script type='text/javascript'>
/* <![CDATA[ */
	wpTinyMCEConfig = {
		defaultEditor: "tinymce"
	}
/* ]]> */
</script>

<script language="javascript" type="text/javascript"
src="/static/js/tiny_mce_config.js"></script>
<!-- /tinyMCE -->


<form action="/admin/{{entrytype}}" method="post">

   <div class="wrap">

      <h2>{%ifequal entrytype "post"%}
      {%trans "Write Post"%}
        {%else%}
      {%trans "Write Page" %}
        {%endifequal%}
 </h2>
      <div id="poststuff">

<div id="submitlink" class="submitbox">

<div id="previewview">
</div>
{%ifequal entrytype "post"%}
<h3>{%trans "Category" %}</h3>
<div class="inside">

<p style="height:120px;overflow-y:scroll">

                    {%for cat in cats%}

                       <input type="checkbox" name="cats"  value="{{cat.slug}}" {%if cat.select %}checked="checked"{%endif%}/>{{cat.name}}<br>
                    {%endfor%}
</p>

</div>
{%endifequal%}
<p class="submit">
<input type="submit" tabindex="4" value="{% trans "Save" %}" name="save" class="button button-highlighted"/>
  <input type="checkbox" style="margin-left:10px;" tabindex="4" value="publish" name="publish" class="button button-highlighted" {%if entry.published%}checked="checked"{%endif%}/>{% trans "Published" %}
</p>

<div class="side-info">
<h5>{%trans "Related" %}</h5>

<ul>
<li><a href="/admin/entries/post">{%trans "Manage All Posts" %}</a></li>
<li><a href="/admin/entries/page">{%trans "Manage All Pages" %}</a></li>

</ul>
</div>
</div>

<div id="post-body2">
<div id="titlediv">
<h3>{%trans "Title" %}</h3>
<div id="titlewrap">
	<input type="text" autocomplete="off" id="title" value="{{entry.title}}" tabindex="1" size="31" name="post_title"/>
</div>
<div class="inside">
	<div id="edit-slug-box">
	</div>
</div>
</div>

<div class="stuffbox" id="postarea">
<h3>
<div class="title">
{%ifequal entrytype "post"%}
      {%trans "Post"%}
        {%else%}
      {%trans "Page" %}
        {%endifequal%}
        </div>
<div class='editor-toolbar'>
    <span class="alignright" id="spn_html"><a id="edButtonHTML" onclick="switchEditors.go('content');" class="">HTML</a></span>
    <span class="alignright tg"  id="spn_visual" ><a id="edButtonPreview" class="active">Visual</a></span>
    <div class='clear'></div>
</div>
<div class='clear'></div>
</h3>

<div id="quicktags" style="display: none;">
	<script type="text/javascript">
/* <![CDATA[ */
	quicktagsL10n = {
		quickLinks: "(Quick Links)",
		wordLookup: "Enter a word to look up:",
		dictionaryLookup: "Dictionary lookup",
		lookup: "lookup",
		closeAllOpenTags: "Close all open tags",
		closeTags: "close tags",
		enterURL: "Enter the URL",
		enterImageURL: "Enter the URL of the image",
		enterImageDescription: "Enter a description of the image"
	}
/* ]]> */


</script>
<script src="/static/js/quicktags.js" type="text/javascript"/>
<script type="text/javascript">edToolbar()</script>

<div id="ed_toolbar"><input type="button" value="b" onclick="edInsertTag(edCanvas, 0);" class="ed_button" accesskey="b" id="ed_strong"/><input type="button" value="i" onclick="edInsertTag(edCanvas, 1);" class="ed_button" accesskey="i" id="ed_em"/><input type="button" value="link" onclick="edInsertLink(edCanvas, 2);" class="ed_button" accesskey="a" id="ed_link"/><input type="button" value="b-quote" onclick="edInsertTag(edCanvas, 3);" class="ed_button" accesskey="q" id="ed_block"/><input type="button" value="del" onclick="edInsertTag(edCanvas, 4);" class="ed_button" accesskey="d" id="ed_del"/><input type="button" value="ins" onclick="edInsertTag(edCanvas, 5);" class="ed_button" accesskey="s" id="ed_ins"/><input type="button" value="img" onclick="edInsertImage(edCanvas);" class="ed_button" accesskey="m" id="ed_img"/><input type="button" value="ul" onclick="edInsertTag(edCanvas, 7);" class="ed_button" accesskey="u" id="ed_ul"/><input type="button" value="ol" onclick="edInsertTag(edCanvas, 8);" class="ed_button" accesskey="o" id="ed_ol"/><input type="button" value="li" onclick="edInsertTag(edCanvas, 9);" class="ed_button" accesskey="l" id="ed_li"/><input type="button" value="code" onclick="edInsertTag(edCanvas, 10);" class="ed_button" accesskey="c" id="ed_code"/><input type="button" value="more" onclick="edInsertTag(edCanvas, 11);" class="ed_button" accesskey="t" id="ed_more"/><input type="button" value="lookup" title="Dictionary lookup" onclick="edSpell(edCanvas);" class="ed_button" id="ed_spell"/><input type="button" value="close tags" title="Close all open tags" onclick="edCloseAllTags();" class="ed_button" id="ed_close"/></div>
</div>

<div id="editorcontainer">

  <textarea style="width: 695px;" cols="40" rows="15" id="content" name="content">{{entry.content}}</textarea>
</div>
</div>
<script type="text/javascript">
 edCanvas = document.getElementById('content');
</script>

<div class="clear"></div>
<div class="stuffbox">
<h3>{% trans "Slug" %}</h3>
<div class="inside">
	<input type="text" value="{{entry.slug}}" tabindex="1" size="30" name="slug"/><br/>
</div>
</div>
{%ifequal entrytype "post"%}
<div class="clear"></div>
<div class="stuffbox" id="tag">
<h3>{% trans "Tag" %}</h3>
<div class="inside">
	<input type="text" id="tags" value="{{entry.strtags}}" tabindex="1" size="30" name="tags"/><br/>
</div>
</div>
{%else%}
<div class="clear"></div>
<div class="stuffbox">
<h3>{% trans "Options" %}</h3>
<div class="inside">
  	<p>
     <span style="font-weight:bold;width:30px">{% trans "Page level:"%} </span><input type="text" id="entry_parent" value="{{entry.entry_parent}}" tabindex="1" size="4" name="entry_parent"/>
  	<p>
      <span  style="font-weight:bold;width:30px">{% trans "Page order:"%}"</span> <input type="text" id="menu_order" value="{{entry.menu_order}}" tabindex="1" size="4" name="menu_order"/>
    </p>
</div>
</div>


{%endifequal%}

<div class="clear"></div>
<div class="stuffbox">
<h3>{% trans "Excerpt" %}</h3>
<div class="inside">
	<textarea name="excerpt" style="width:98%"/>{%if entry.excerpt%}{{entry.excerpt}}{%endif%}</textarea><br/>
</div>
</div>


<input type="hidden" value="{{entry.key}}" name="key"/>
<input type="hidden" value="{{action}}" name="action"/>

</div>
</div>

   </div>
   </form>

 {% endblock  %}